From: Stefan Monnier Date: Mon, 24 Jan 2011 20:10:04 +0000 (-0500) Subject: * lisp/progmodes/perl-mode.el (perl-syntax-propertize-special-constructs): X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5079 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=cbee3a5d198406268d6095f2f8092695b5445b38;p=emacs.git * lisp/progmodes/perl-mode.el (perl-syntax-propertize-special-constructs): Don't move backward, so as not to fall in an inf-loop. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 919becd892d..88ed1e93b74 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-01-24 Stefan Monnier + * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs): + Don't move backward, so as not to fall in an inf-loop (bug#7736). + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): (bug#7735) Handle ?" and friends differently (e.g. don't use backrefs). diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 85429ac96af..64cf2c989c2 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -360,7 +360,8 @@ The expansion is entirely correct because it uses the C preprocessor." (t ;; This is regexp like quote thingy. (setq char (char-after (nth 8 state))) - (let ((twoargs (save-excursion + (let ((startpos (point)) + (twoargs (save-excursion (goto-char (nth 8 state)) (skip-syntax-backward " ") (skip-syntax-backward "w") @@ -384,7 +385,8 @@ The expansion is entirely correct because it uses the C preprocessor." (goto-char (1+ (nth 8 state))) (up-list 1) t) - (scan-error nil)) + ;; In case of error, make sure we don't move backward. + (scan-error (goto-char startpos) nil)) (not (or (nth 8 (parse-partial-sexp (point) limit nil nil state 'syntax-table)) ;; If we have a self-paired opener and a twoargs